<template>
	<div class="about">
		<!-- {{list}} -->
		<div v-for="item in list" :key="item.id">
			<h3>{{item.name}}</h3>
			<h3>{{item.price}}</h3>
			<p>产地：{{item.add}}</p>
			<p>{{item.score}}|{{item.day}}|{{item.tel}}</p>
			<h4>{{item.tile}}</h4>
			<p>{{item.aan}}</p>
			<img :src="item.avatar" alt="">
		</div>

	</div>
</template>
<script>
	// 导入utils request
	import request from '@/utils/request.js'
	export default {
		data(){
			return{
				list:[]
			}
		},
		created() {
			// 请求随机数据
			request.post("/v5/user")
			.then(res=>{
				console.log("随机",res.data);
				this.list=res.data.data;
			})
			// 带参数
			request.post("/v5/jok",{"id":25,key:"xyz"})
			.then(res=>{
				console.log("参数",res.data)
			})
			// post请求
			request.post("/v5/item")
			.then(res=>{
				console.log("post",res.data);
			})
			// request.get("http://abc.com/v5/list")
			request.get("/v5/list")
				.then(res => {
					console.log("模拟数据", res.data)
				})
				.catch(err => {
					console.log(err);
			})
			request.get("/api/app/v3/category")
			.then(res=>{
				console.log("多多分类",res.data)
			})
			.catch(err => {
				console.log(err);
			})
		}
	}
</script>
